package com.merge.skarabee;
import android.os.Bundle;
import android.sax.TextElementListener;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * A simple {@link android.support.v4.app.Fragment} subclass. Activities that
 * contain this fragment must implement the
 * {@link PortInfoFragment.OnFragmentInteractionListener} interface to handle
 * interaction events. Use the {@link PortInfoFragment#newInstance} factory
 * method to create an instance of this fragment.
 * 
 */
public class PortInfoFragment extends Fragment {

	//private View v;

	private int portNumber;
	private String voltage;
	private String current;
	private TextView portNumValueTV;
	private TextView currentValueTV;
	private TextView voltageValueTV;
	
	
	
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        //return super.onCreateView(inflater, container, savedInstanceState);
        LayoutInflater lf = getActivity().getLayoutInflater();   
        View view =  lf.inflate(R.layout.fragment_port_info, container, false);
       
        //View v =  inflater.inflate(R.layout.fragment_port_info, null);
        portNumValueTV = (TextView)view.findViewById(R.id.textViewPortNumberValue);
        currentValueTV = (TextView)view.findViewById(R.id.textViewCurrentValue);
        voltageValueTV = (TextView)view.findViewById(R.id.textViewVoltageValue);
        
        
        
        return view;
    	
    }

    
    @Override
    public void onPause() {
        super.onPause();
    }

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
    }
	
    
    public void setVoltage(String voltage){
    	this.voltage = voltage;
    	voltageValueTV.setText(voltage);
    }

    public void setCurrent(String current){
    	this.current = current;
    	voltageValueTV.setText(current);
    }
    
    /**
	 * @return the portNumber
	 */
	public int getPortNumber() {
		return portNumber;
	}

	/**
	 * @param portNumber the portNumber to set
	 */
	public void setPortNumber(int portNumber) {
		this.portNumber = portNumber;
		
		portNumValueTV.setText("" + portNumber);
	}

}
